package br.edu.ufcg.embedded.util;

import java.io.IOException;

/*import br.edu.ufcg.embedded.domain.DirectedGraphBuilder;
import br.embedded.socialapp.data.FriendshipDAO;*/

public class ParserTest {

	private static final String FILE = "/home/daniel/Projetos/Data/release-livejournal-links.txt";
	private static final String FILE_EXTENSION = ".ttt2";
	private static final String BULK_PATH = "/home/daniel/Projetos/Data/bulk/"; 
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		//FriendshipDAO.getInstance().truncate();
		
		
		FileConsumer consumer = new FileConsumer(BULK_PATH, FILE_EXTENSION);
		consumer.start();
		
		Parser parser = new Parser();
		parser.setFileGenerator(new MultiFileGenerator(BULK_PATH, "file_", FILE_EXTENSION, 50000));
		
		try {
			parser.parse(FILE, "\t" );
		} catch (IOException e1) {
			e1.printStackTrace();
		}
		
		consumer.producerFinished();
		
		try {
			consumer.join();
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		
		//DirectedGraphBuilder graphBuilder = FriendshipDAO.getInstance().getSocialConnections();
		
		//System.out.println(graphBuilder.getGraph().vertexSet().size());
		
	}
}